#########################
#   Author : leilei qin    #
#   Date : 2025/06/24   #
#   Id : SM2892         #
#########################

from compareResult.compareUtils import Compare
from dbResps.queryEmployPerformanceReport import *
from apiRespsAnalyze.queryEmployPerformanceReportFromApi import *

# 非当天 6/17号
startTime = 1718557200000
endTime = 1718729999000


getEmployPerformanceDetailFromDB_Result = getQueryEmployPerformanceReportFromDB(startTime, endTime)
dateFormatTemp1 = lambda x: datetime.strptime(str(dc.timestamp2Data(x)), "%Y/%m/%d %H:%M:%S").strftime("%Y/%m/%d")
getEmployPerformanceDetailFromApi_Result = queryEmployPerformanceReport(startTime, endTime)

if __name__ == "__main__":
    compareResult = Compare.compare(getEmployPerformanceDetailFromDB_Result, getEmployPerformanceDetailFromApi_Result)
    if compareResult:
        print('compare success')
    else:
        print('compare fail')
        print(getEmployPerformanceDetailFromDB_Result)
        print(getEmployPerformanceDetailFromApi_Result)